package com.ly.emp.controller.common;

import com.ly.common.core.bean.R;
import com.ly.emp.bean.dto.DynamicTableDTO;
import com.ly.emp.bean.vo.DynamicTableHeadAndChildrenListVO;
import com.ly.emp.bean.vo.DynamicTableHeadListAndDatasVO;
import com.ly.emp.bean.vo.DynamicTableHeadListVo;
import com.ly.emp.service.DynamicTableService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 公共动态表头
 *
 * @author luoyun
 * @Date: 2023-05-18
 */
@Tag(name = "hub公共-动态表头模块")
@Slf4j
@RestController
@RequestMapping("/emp/dynamicTable")
@RequiredArgsConstructor
public class DynamicTableController {

    private final DynamicTableService dynamicTableService;

    /**
     * 基础定额积分表头
     *
     * @param
     * @return
     */
    @Operation(summary = "基础定额积分表头")
    @PostMapping("/getQuotaFactorOrgHeader")
    public R<List<DynamicTableHeadListVo>> getQuotaFactorOrgHeader(@Validated @RequestBody DynamicTableDTO dto) {
        return dynamicTableService.getQuotaFactorOrgHeader(dto);
    }

    /**
     * 工分登记系数表头
     *
     * @param
     * @return
     */
    @Operation(summary = "工分登记系数表头")
    @PostMapping("/getTeamResultOrderXsHeader")
    public R<List<DynamicTableHeadListAndDatasVO>> getTeamResultOrderXsHeader(@Validated @RequestBody DynamicTableDTO dto) {
        return dynamicTableService.getTeamResultOrderXsHeader(dto);
    }

    /**
     * 汇总发布表头
     *
     * @param
     * @return
     */
    @Operation(summary = "汇总发布表头")
    @PostMapping("/getTeamResultHeader")
    public R<List<DynamicTableHeadListVo>> getTeamResultHeader(@Validated @RequestBody DynamicTableDTO dto) {
        return dynamicTableService.getTeamResultHeader(dto);
    }

    /**
     * 综合评价指标管理动态表头
     *
     * @param
     * @return
     */
    @Operation(summary = "综合评价指标管理动态表头")
    @PostMapping("/getTemplateConfigHeader")
    public R<List<DynamicTableHeadListVo>> getTemplateConfigHeader(@Validated @RequestBody DynamicTableDTO dto) {
        return dynamicTableService.getTemplateConfigHeader(dto);
    }

    /**
     * 考核登记-综合评价表头
     *
     * @param
     * @return
     */
    @Operation(summary = "考核登记-综合评价表头")
    @PostMapping("/getResultEvaluateHeader")
    public R<List<DynamicTableHeadAndChildrenListVO>> getResultEvaluateHeader(@Validated @RequestBody DynamicTableDTO dto) {
        return dynamicTableService.getResultEvaluateHeader(dto);
    }

    /**
     * 考核登记-工单二维表评分表头
     *
     * @param
     * @return
     */
    @Operation(summary = "考核登记-工单二维表评分表头")
    @PostMapping("/getResultOrderForTwoDimensionalHeader")
    public R<List<DynamicTableHeadAndChildrenListVO>> getResultOrderForTwoDimensionalHeader(@Validated @RequestBody DynamicTableDTO dto) {
        return dynamicTableService.getResultOrderForTwoDimensionalHeader(dto);
    }
}
